#include "BaseCommand.h"
#include "CommandManage.h"

//////////////////////////////////////////////////////////////////////////
// Implementation of CCmdBase

void CCmdBase::BeginCmd()
{ 
	ModifyOtherCmdState(); 
	SetTransformState(false);

	_bIsAlive = true; 
	CCmdFactory::AddToLiveList(this);

	BeginCmdImplement();
}

void CCmdBase::EndCmd()
{
	_bIsAlive = false; 
	EndCmdImplement(); 

	SetTransformState(true);

	CCmdFactory::DelLiveCmd(this);
}

void CCmdBase::ModifyOtherCmdState()
{
	// Default: stop alive cmds before a new command
	// It can be overrided by specific command
	CCmdFactory::StopAllLiveCmd();

	return;
}